const { defineConfig } = require('@vue/cli-service')
const webpack = require('webpack')
// console.log(process.env.NODE_ENV)  // development
module.exports = defineConfig({
  // 不可以
  // optimization: {
  //   runtimeChunk: 'single'
  // },
  devServer: {
    // 必须同时配置 port 和 client，其中 port 就是本地启动用到的端口
    hot: true,
    liveReload: true,
    port: 8080,
    client: {
      webSocketURL: 'ws://127.0.0.1:8080/ws'
    },
    watchFiles:['./src/index.html']
  },
  // 不支持了
  // plugins: [
  //   new webpack.HotModuleReplacementPlugin()
  // ],
  transpileDependencies: true,
  // css: {
  //   loaderOptions: {
  //     sass: {
  //       implementation: require('node-sass')
  //     }
  //   }
  // },

  css: {
    loaderOptions: {
      sass: {
        sassOptions: {
          outputStyle: "compressed"
        }
      }
    }
  }
})
